package thired.class02_EOR;

public class Class03_KM {
    //一个数组只有一个数出现m次其他数出现k次
    public static int KM(int[] nums,int m,int k){
        int[] t = new int[32];
        for (int i = 0; i < nums.length; i++) {
            for (int j = 0; j < 32; j++) {
                t[j] += (nums[i] >> j) & 1;
            }
        }
        int res = 0;
        for (int i = 0; i < 32; i++) {
            if(t[i] % k != 0){
                res |= 1 << i;
            }
        }
        return res;
    }
}
